package com.eeepay.eeepay_v2.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.eeepay.eeepay_v2.R;
import com.eeepay.v2_library.adapter.ABBaseAdapter;
import com.eeepay.v2_library.adapter.ABViewHolder;
import com.eeepay.v2_library.view.LeftRightText;

import cn.eeepay.api.grpc.nano.MerAddModular;

/**
 * Created by Ching on 2016/7/20.
 */
public class LimitQueryAdapter extends ABBaseAdapter<MerAddModular.MerServiceQuota> {

    public LimitQueryAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_into_query_limit;
    }

    @Override
    public void convert(ABViewHolder holder, MerAddModular.MerServiceQuota model) {
        holder.setRightText(R.id.lrt_query_limit_name, model.serviceName);
//        String cardType = null;
//        switch (model.cardType) {
//            case "0":
//                cardType = "不限";
//                break;
//            case "1":
//                cardType = "信用卡";
//                break;
//            case "2":
//                cardType = "储蓄卡";
//                break;
//        }
        holder.setRightText(R.id.lrt_query_limit_card_type, model.cardType);
//        String serviceTime = null;
//        switch (model.holidaysMark) {
//            case "0":
//                serviceTime = "不限";
//                break;
//            case "1":
//                serviceTime = "工作日";
//                break;
//            case "2":
//                serviceTime = "节假日";
//                break;
//        }
        holder.setRightText(R.id.lrt_limit_single_minimum,model.singleMinAmount + "元");
        holder.setRightText(R.id.lrt_query_limit_time, model.holidaysMark);
        holder.setRightText(R.id.lrt_limit_single_largest, model.singleCountAmount + "元");
        holder.setRightText(R.id.lrt_limit_single_day_largest, model.singleDayAmount + "元");
        holder.setRightText(R.id.lrt_limit_day_card_largest, model.singleDaycardAmount + "元");
        holder.setRightText(R.id.lrt_limit_day_card_largest_count, model.singleDaycardCount + "笔");
    }
}
